package com.hamilton.erik.pt.core.enumeration;

public enum MedicalAction {

	SHOTS("Shots", "Received shots."),
	DECLAWED("Declawed", "Was declawed."),
	SPAY("Spay", "Spayed."),
	NEUTER("Neuter", "Neutered.");
	
	private String medicalAction;
	private String description;
	
	private MedicalAction(String action, String description) {
		this.medicalAction = action;
		this.description = description;
	}
	
	public static MedicalAction fromAction(String value) {
		for(MedicalAction action : values()) {
			if(action.getAction().equalsIgnoreCase(value)) {
				return action;
			}
		}
		
		return null;
	}
	
	public static MedicalAction fromDescription(String value) {
		for(MedicalAction action : values()) {
			if(action.getDescription().equalsIgnoreCase(value)) {
				return action;
			}
		}
		
		return null;
	}
	
	public String getAction() {
		return medicalAction;
	}
	
	public String getDescription() {
		return description;
	}
	
	public String toString() {
		return description;
	}
	
}
